package com.baidu.aip.Controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.text.SimpleDateFormat;
import java.util.Date;

@RestController
@RequestMapping("/sampleController")
public class sampleController {

    @GetMapping("/simpled.action")
    public ModelAndView simpledList(){
        ModelAndView mav=new ModelAndView("index");
        SimpleDateFormat forms = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            mav.addObject("time", forms.format(new Date()));
           mav.getModel().put("name", "caoyc");
        return mav;
    }
}
